//
//  ViewController.m
//  EJWarningCardView
//
//  Created by 刘爽 on 2020/2/10.
//  Copyright © 2020 刘爽. All rights reserved.
//

#import "ViewController.h"
#import "EJWarningCardView.h"

@interface ViewController ()<EJWarningCardViewDelegate>

@property (nonatomic, strong) EJWarningCardView * warningView;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"更多" style:UIBarButtonItemStyleDone target:self action:@selector(handleClickRightItem)];

    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"show" forState:UIControlStateNormal];
    [self.view addSubview:btn];
    [btn addTarget:self action:@selector(handleClickButton:) forControlEvents:UIControlEventTouchUpInside];
    btn.frame = CGRectMake(200, 200, 64, 36);
    [btn setBackgroundColor:UIColor.redColor];
}

#pragma mark - action
- (void)handleClickButton:(UIButton *)sender {
    
    EJWarningCardView * warningView = [[EJWarningCardView alloc] initWithTitleArray:@[@"item 1", @"item 2"] imageArray:nil AtPoint:CGPointMake(CGRectGetMaxX(sender.frame), CGRectGetMaxY(sender.frame)) AndSize:CGSizeMake(100, 88) EdgeInset:UIEdgeInsetsZero delegate:self];
    _warningView = warningView;
    _warningView.showFrom = WarningCardShowFromLeftTop;
    _warningView.backgroundImg = [UIImage imageNamed:@"menu_bg"];
    _warningView.isShowBg = NO;
    [_warningView show];
}

@end
